<?php

namespace Fize\Third\WechatWork\Qyapi;

use Fize\Third\WechatWork\QyapiAbstract;

/**
 * ID转换
 */
class Idconvert extends QyapiAbstract
{

    /**
     * 将应用获取的外部用户临时idtmp_external_userid，转换为external_userid。
     * @param int   $business_type            业务类型
     * @param int   $user_type                用户类型
     * @param array $tmp_external_userid_list 外部用户临时id，最多不超过100个
     * @return array
     */
    public function convertTmpExternalUserid(int $business_type, int $user_type, array $tmp_external_userid_list): array
    {
        $params = [
            'business_type'            => $business_type,
            'user_type'                => $user_type,
            'tmp_external_userid_list' => $tmp_external_userid_list
        ];
        return $this->httpPost("/idconvert/convert_tmp_external_userid?access_token={$this->accessToken}", $params);
    }
}